Thisbin equ 800h
org 	8000000h		;设置下一个新段地址

mov ax,Thisbin               ;设置段寄存器
mov es,ax
mov ds,ax


mov ax,0b800h
mov ds,ax
mov byte ds:[0],'k'

kaishi:
mov cl,01111100b        ;cl颜色
mov di,hello1             ;目标偏移地址
mov si,160*5+6                ;显示位置
call duohanxians

mov ax,0b800h
mov ds,ax
mov byte ds:[0],'k'

call x

;(((((((((((((((((((((((((((((((((((子))))))))))))))))))))))))))))))))))))))
;--------------------------------------------------

test:               ;引用
mov ax,0
mov bx,0
mov cx,0
mov dx,0
mov di,0
cwd             	; "clear" DX for perfect alignment
mov 	al,0x13
o: 		int 0x10	; set video mode AND draw pixel
mov 	ax,cx		; get column in AH
add		ax,di		; offset by framecounter
xor 	al,ah		; the famous XOR pattern
and 	al,32+8		; a more interesting variation of it
mov 	ah,0x0C		; set subfunction "set pixel" for int 0x10
loop 	o			; loop 65536 times
inc 	di			; increment framecounter
in 		al,0x60		; check keyboard ...
dec 	al			; ... for ESC
jnz 	o			; rinse and repeat
ret					; quit program








duohanxians:


mov ax,0b800h
mov ds,ax
mov bp,si

xunhuanyi:
cmp byte es:[di],'$'
je neext
cmp byte es:[di],0
je neext2

mov al,es:[di]
mov ds:[si],al
inc si
inc di
mov ds:[si],cl
inc si
call yanshi
jmp xunhuanyi

neext2:
mov si,bp
add bp,160
add si,160
inc di
jmp xunhuanyi

neext:
ret
;=================================


yanshi:
push ax
push cx
push dx
mov ah,86h
mov cx,0
mov dx,8480h
int 15h
pop dx
pop cx
pop ax
ret


hello1:
db 'Welcome to ShengKong OS tmp 1.3',0
db 'We are success!','$'


x:
hlt
mov ah,0
int 16h
cmp al,' '
jne zailaiyici
jmp x


zailaiyici:
cleanshow:
mov ax,0b800h
mov ds,ax
mov di,0
mov cx,2000
sd:
   mov byte [di],' '
   inc di
   mov byte [di],00000000b
   inc di
   loop sd
call fff
jmp kaishi
ret





times 1474560-($-$$) db 0
